﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<FillCartridgeBBB.Models.Move>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	List
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>List</h2>

    <table>
        <tr>
            <th></th>
            <th>
                Підрозділ
            </th>
                        <th>
                Принтер
            </th>
                        <th>
                Картридж
            </th>
            
                        <th>
                Забраний
            </th>
            
                        <th>
                Поставлений
            </th>
            
            <th>
                Дата
            </th>
        </tr>

    <% foreach (var item in Model) { %>
    
        <tr>
            <td>                
                <%= Html.ActionLink("Delete", "Delete", new { id=item.MoveId })%>
            </td>
            <td>
                          <%=Html.ActionLink(item.Department.Name, "Details", "Department",
                                                new {id = item.Department.DepartmentId}, null)%>
            </td>
                        <td>
                          <%=Html.ActionLink(item.Printer.PrinterName, "Details", "Printer",
                                                new {id = item.Printer.PrinterId}, null)%>
            </td>
                        <td>
                          <%=Html.Encode(item.Printer.CartridgeName)%>
            </td>
                                    <td>
                          <%=Html.Encode(item.CartridgeOld.SerialNumber)%>
            </td>
                                    <td>
                          <%=Html.Encode(item.CartridgeNew.SerialNumber)%>
            </td>           
            
            <td>
                <%= Html.Encode((item.DateMove.HasValue)?item.DateMove.Value.ToString("dd MMMM yyyy"):"")%>
            </td>

        </tr>
    
    <% } %>

    </table>

    <p>
        <%= Html.ActionLink("Create New", "Create") %>
    </p>

</asp:Content>

